package lxs.tool.liberator.work.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lxs.tool.liberator.work.param.in.MultiOptions;
import lxs.tool.liberator.work.param.out.ClassOut;
import lxs.tool.liberator.work.pojo.Class;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ClassMapper extends BaseMapper<Class> {
    List<ClassOut> showTable(String pid);

    List<Class> getMeta(String dbname);

    List<Class> getProjectClass(String projectId);

    void updateJavaName(@Param("name") String name, @Param("id") String id);

    void updateIdColumn(@Param("columnId") String columnId, @Param("id") String id);

    void deleteByProjectIdAndUnExist(@Param("id") String id, @Param("names") List<String> names);

    String getTheExistId(@Param("projectId") String projectId, @Param("nameInDb") String nameInDb);

    String getIdByName(String name);

    List<MultiOptions> getOptions(String pid);

    List<MultiOptions> getTypeOptions(String pid);

    void clear(@Param("className") String className);

    Integer getCount(@Param("className") String className);

    void setCount(@Param("classId") String classId, @Param("count") Integer count);

    String randomGetOneByTableAndColumn(@Param("tableName") String tableName,
                                        @Param("columnName") String columnName,
                                        @Param("number") Integer number);
}
